package com.syqc.entity

import android.os.Parcelable
import com.chad.library.adapter.base.entity.MultiItemEntity
import com.syqc.comlib.AppConfigs
import com.syqc.comlib.UserConstant
import com.syqc.monitor.ui.text.Status
import com.syqc.utils.Keys
import kotlinx.parcelize.Parcelize
import java.io.Serializable


/** @Author pc_hfjs @Date 2022/1/18 15:18 @Desc 新接口统一文件 */
@Parcelize
data class OilDayBean(
    val cfgs: Map<String, List<String>>?,
    val datas: List<Data>?
) : Parcelable {
    @Parcelize
    data class Data(
        val carId: String, // 105160
        val day: String, // 2022-01-16
        var downTimes: Int, // 0
        var downTotal: Float, // 0
        val leakTimes: Int, // 0
        var leakTotal: Float, // 0
        val list: String?, // [{"e":{"lat":31.3238,"lng":121.637704,"m":1421.0,"mile":0.0,"time":"2022-01-17 12:21:12","v":182.05},"s":{"lat":31.3238,"lng":121.637704,"m":1422.0,"mile":0.0,"time":"2022-01-17 12:19:12","v":182.19},"t":"D"}]
        var mile: Float, // 0
        val type: String, // 1
        val typeId: String?, // 6
        val upTimes: Int, // 0
        var upTotal: Float, // 0
        var oilAvg: Float?
    ) : Parcelable
}

/** @Author pc_hfjs @Date 2022/1/18 15:18 @Desc 新接口统一文件 */
@Parcelize
data class RecentOil(
    val cfgs: Map<String, List<String>>?,
    val datas: List<Data>?
) : Parcelable {
    @Parcelize
    data class Data(
        val carId: String, // 105160
        val day: String, // 2022-01-16
        var downTimes: Int, // 0
        var downTotal: Float, // 0
        val leakTimes: Int, // 0
        var leakTotal: Float, // 0
        val list: String?, // [{"e":{"lat":31.3238,"lng":121.637704,"m":1421.0,"mile":0.0,"time":"2022-01-17 12:21:12","v":182.05},"s":{"lat":31.3238,"lng":121.637704,"m":1422.0,"mile":0.0,"time":"2022-01-17 12:19:12","v":182.19},"t":"D"}]
        var mile: Float, // 0
        val type: String, // 1
        val typeId: String?, // 6
        val upTimes: Int, // 0
        var upTotal: Float, // 0
        var oilAvg: Float?,
        var runTotal: Float?,
        var idlingTotal: Float?,
        val totalBy100km: String?,
        val runBy100km: String?,
        val teamName: String?,
    ) : Parcelable
}

@Parcelize
data class OilType(
    val id: String,
    val name: String,
    val unit: String,
    val precision: String,
    val info: ArrayList<OilDayBean.Data> = arrayListOf()
) : Parcelable

/** 日油耗详情 */
@Parcelize
data class OilDetail(
    val adds: List<AddLeak>,
    val details: List<Detail>,
    val leaks: List<AddLeak>
) : Parcelable {
    @Parcelize
    data class Detail(
        val acc: Boolean, // true
        val index: Int, // 0
        val m: Float, // 1368
        val mile: Int, // 0
        val s: Float, // 0
        val time: String, // 2022-01-25 00:00:19
        val v: Float, // 175.27
        val v0: Float // 175.27
    ) : Parcelable

    @Parcelize
    data class AddLeak(
        val etime: String, // 2022-01-25 00:08:49
        val evalue: Float, // 148.24
        val mile: Int, // 300
        val stime: String, // 2022-01-25 00:00:19
        val svalue: Float, // 175.27
        var value: Float // 27.029999
    ) : Parcelable
}

/**
 * 模拟量日统计
 *
 * @property carId
 * @property cfg 模拟量配置
 * @property day 日期
 * @property downTimes 总耗油次数
 * @property downTotal 总耗油量
 * @property idlingTimes 总怠速次数
 * @property idlingTotal  总怠速耗油量
 * @property leakTimes  总漏油次数
 * @property leakTotal  总漏油量
 * @property list         加漏油详情列表
 * @property mile       里程
 * @property type
 * @property typeId
 * @property upTimes   总加油次数
 * @property upTotal   总加油量
 * @constructor Create empty Oil day
 */
data class OilDay(
    val carId: String,
    val cfg: String?,
    val day: String?,
    val list: String,
    val type: String?,
    val typeId: String?,
    var downTimes: Int,
    var downTotal: Float,
    var idlingTimes: Int,
    var idlingTotal: Float,
    var leakTimes: Int,
    var leakTotal: Float,
    var upTimes: Int,
    var mile: Float,
    var mileKm: Double,
    var oilOvg: Float,
    var upTotal: Float,
    var name: String,
    var unit: String,
    var precision: Int,
    var runTotal: Float,
    var totalBy100km: Double,
    var runBy100km: Double,
    var warkLong: Long?,
)

data class TempDay(
    val carId: String,
    val cfg: String?,
    val day: String?,
    val type: String?,
    val typeId: String?,
    var mile: Float?,
    var mileKm: Double?,
    var name: String?,
    var unit: String?,
    var precision: Int?,
)

class TempData(
    val time: String,
    val tampA: String? = null,
    val tampB: String? = null,
    val mile: Float,
    val speed: Float
)

data class StatsType(
    val id: String,
    val name: String,
    val unit: String,
    val precision: Int,
    val info: ArrayList<OilDay> = arrayListOf()
)

/**
 * 模拟量配置
 *
 * @property name  模拟量名称
 * @property unit   单位
 * @property precision 精确小数位
 * @property type
 * @property typeId
 * @constructor Create empty Oil cfg
 */
data class OilCfg(
    val name: String?,
    val unit: String,
    val precision: Int,
    val typeId: String?
)

/**
 * List info
 *
 * @property t  U/L  U:加油 L:漏油
 * @property s  开始点
 * @property e  结束点
 * @constructor Create empty List info
 */
data class ListInfo(
    val t: String,
    val s: OilPoint?,
    val e: OilPoint?,
)

/**
 * 开始结束点信息
 *
 * @property acc  开关
 * @property lat
 * @property lng
 * @property mile 里程
 * @property time 时间
 * @property s    速度
 * @property m    模拟值
 * @property v    真实值
 * @constructor Create empty Oil point
 */
data class OilPoint(
    val acc: Boolean,
    val lat: Double,
    val lng: Double,
    val mile: Float,
    val time: String,
    val s: Int,
    val m: Float,
    val v: Float
)

data class Permissions(
    val permission: String,
    val type: String,
    val desc: String,
    val permission2: String = "",
    var isOpen: Boolean = false,
)

/** 定位详细信息 */
data class GpsDetail(
    val accTime: String, // 当前[开] 今日开:12时56分26秒
    val addr: String?, // 安徽省阜阳市颍州区文峰街道;阜王路236号;华联大厦-东门,阜阳市农业委员会办公二区,金龙鱼(华联大厦提货点)
    val alarms: String?,
    val bigIcon: String, // 轿车/1.png
    val bigIconLink: String, // http://106.14.186.44:9999/gps-web/rs/img/car/bigs/轿车/1.png
    val blat: String, // 32.89647204943718
    val blng: String, // 115.81851493347635
    val carId: String, // 105235
    val carName: String, // 演示04
    val carPlate: String, // 演示04
    val carType: String, // 轿车
    val drct: String, // 0
    val drctCn: String, // 正北
    val drvName: String, // 张国栋
    val drvPhone: String,
    val drvSign: String?,
    val drvSignPhone: String?,
    val drvSignTime: String,
    val drvSignTimeLong: String,
    val expState: String, // 0
    val expTime: String? = "", // 2023-01-21
    val exts: String, // {"tcp":"bb","bd":"02","be":"0","c7":"4","sz1":"01","b0":"0","b1":"0","srvTime":"20220316153232"}
    val glat: String, // 32.89018909766766
    val glng: String, // 115.81208471785094
    val lat: String, // 32.11972192769155
    val lng: String, // 118.83891059281379
    val iconLink: String, // http://106.14.186.44:9999/gps-web/rs/img/map/car/default/10.png
    val mile: String, // 231783.47
    val oil: String, // 0.0升
    val photoIcon: String,
    val plateColor: String, // 黄色
    val plateColorCode: String?, // 黄色
    val preMile: String, // 489.84
    val runStopTime: String, // 停-42分11秒
    val runStopTimeSecond: String, // 2531
    val satl: String, // 强-28
    val sgn: String, // 强-28
    val simCard: String, // 13300000004
    val speed: String, // 0
    val st1: List<NameValue>?,
    val st2: List<NameValue>?,
    val st3: List<NameValue>?,
    val st4: List<NameValue>?,
    val st5: List<NameValue>?,
    val state: String, // 10
    val stateCn: String, // 在线-停车-ACC开
    val teamId: String, // 4771
    val teamName: String, // 一车队
    val time: String, // 2022-03-16 15:32:33
    val tmnExpirTime: String?,
    val tmnKey: String?, // 13300000004
    val tmnNo: String, // 13300000004
    val tmnType: String?,
    val owner: String?,
    val ownerPhone: String?,
    val uploadFlag: String, // false
    val videoAlarmTypes: List<String>?,
    val videos: String,// {"vs":"4:通道1:0:v,2::0:v,3::0:v,1:通道4:0:v"}
    val tmnMakerModel: String?,
    val tmnSimMeal: String?,
    val tmnSimType: String?,
    val des: String?,
    val todayRun: Long?,
    val appDoor1: String?,
    val appDoor2: String?,
    val appDoor3: String?,
    val appDoor4: String?,
    val appDoor5: String?,
    val offlineDuration: String?,
    val accOn: Boolean,
    val curAcc: Long,
    val tmnMile: String?,
    val c4: String?,
    val protocols: String?,
    val coiledDriving: String?
)

/** 历史轨迹 */

data class HistoryLine(
    val alarmData: List<AlarmData>,
    val countData: CountData,
    val locations: List<Location>,
    val overspeedData: List<OverspeedData>,
    val stopData: List<StopData>,
    val runData: List<RunData>,
    val itinerary: List<Itinerary>?,
) {
    data class AlarmData(
        val addr: String, // 北京市海淀区花园路街道;北土城西街甲103号;健德门(地铁站),北京万盛商务会馆-A区,北京万盛商务会馆
        val alarmType: String, // 禁行报警
        val blat: String, // 39.98370717817938
        val blng: String, // 116.38775510989693
        val glat: String, // 39.97750718201819
        val glng: String, // 116.38130702773776
        val lat: String, // 39.976116
        val lng: String, // 116.375072
        val long: String, // 6分31秒
        val solveTime: String, // 2022-03-28 04:50:14
        val speed: String, // 52
        val startTime: String, // 2022-03-28 01:50:08
        val mediaDetail: ArrayList<AlarmMedia>?
    )

    data class CountData(
        val avgSpeed: String, // 37
        val gpsSize: String, // 432
        val maxSpeed: String, // 117
        val mile: String, // 31.53
        val moveLong: String, // 1时9分35秒
        val stopLong: String, // 48分21秒
        val avgMove: String?,
        val totalLong: String?,
    )

    data class Location(
        val addr: String, // 北京市西城区月坛街道;复兴门北大街甲1号;北京月坛体育馆,金融四界,北京金融资产交易所
        val blat: String, // 39.92225687799531
        val blng: String, // 116.36302800297184
        val drct: String, // 177
        val drctCn: String, // 偏南
        val glat: String, // 39.916489006754574
        val glng: String, // 116.3564644408596
        val lat: String, // 39.915136
        val lng: String, // 116.35028
        val mile: String, // 118524.60
        val satl: String, // 5
        val speed: String, // 22
        val time: String, // 2022-03-28 00:00:03
        var dmile: String // 2022-03-28 00:00:03
    )

    data class OverspeedData(
        val blat: String, // 39.90571196611245
        val blng: String, // 116.36322382790567
        val endAddr: String, // 北京市西城区;西便门桥;复兴门(广电总局),明北京城城墙遗迹,广电总局宿舍
        val endTime: String, // 2022-03-28 00:02:03
        val glat: String, // 39.89993660152598
        val glng: String, // 116.35664672808063
        val lat: String, // 39.898584
        val lng: String, // 116.350464
        val long: String, // 瞬时超速
        val maxSpeed: String, // 52
        val mile: String, // 0.0米
        val startAddr: String, // 北京市西城区;西便门桥;复兴门(广电总局),明北京城城墙遗迹,广电总局宿舍
        val startTime: String // 2022-03-28 00:02:03
    )

    data class StopData(
        val add: String, // 北京市海淀区;吴家村路10号院-9号楼-8门-1层-102室;沄沄国际,海淀区文明社区,莲宝路10号院
        val blat: String, // 39.89576993220466
        val blng: String, // 116.30456976220756
        val dmile: String, // 0.00
        val endTime: String, // 2022-03-28 00:24:24
        val glat: String, // 39.889563405536585
        val glng: String, // 116.29812961215428
        val lat: String, // 39.888316
        val lng: String, // 116.292072
        val long: String, // 13分
        val mile: String, // 7.71
        val startTime: String // 2022-03-28 00:11:24
    )

    data class RunData(
        val endAddr: String, // 北京市西城区;西便门桥;复兴门(广电总局),明北京城城墙遗迹,广电总局宿舍
        val endTime: String, // 2022-03-28 00:02:03
        val long: String, // 瞬时超速
        val mile: String, // 0.0米
        val dmile: String?, // 0.0米
        val startAddr: String, // 北京市西城区;西便门桥;复兴门(广电总局),明北京城城墙遗迹,广电总局宿舍
        val startTime: String // 2022-03-28 00:02:03
    )

    data class Itinerary(
        val avgSpeed: Int,
        val desc: String,
        val eaddr: String,
        val elat: Double,
        val elng: Double,
        val emile: Int,
        val etime: String,
        val maxSpeed: Int,
        val mile: Int,
        val saddr: String,
        val slat: Double,
        val slng: Double,
        val smile: Int,
        val stime: String
    )
}

/** 查询信号线或者提醒 */
data class SgnRemind(
    val sgnStts: MutableList<NameValue>,
    val reminds: MutableList<NameValue>
)

/** 适用于所有Key Value */
data class NameValue(
    val name: String, // 近光灯
    val value: String // 关
)

/** 版本信息 */
data class Version(
    val id: String? = "",
    val desc: String? = "",
    val url2: String? = "",
    val prjName: String? = "",
    val name: String? = "",
    val seq: String? = "",
    val date: String? = "",
    val type: String? = "",
    val url: String? = "",
    val version: String? = "",
    val qr: String? = ""
)

/** 系统消息 */
@Parcelize
data class SystemMessage(
    var id: String = "",
    var date: String = "",
    var title: String = "",
    var msg: String = "",
    var auser: String = "",
    var files: String = "",
    var isRead: Boolean = false,
    var fileUrl: String = ""
) : Parcelable

/** 系统消息 */
@Parcelize
data class SystemMessages(
    val list: MutableList<SystemMessage> = mutableListOf()
) : Parcelable

/** 车队信息 */
data class TeamInfo(
    val teamName: String = "",
    val carNum: Int = 0,
    val pid: String = "",
    val teamId: String = ""
)


/** 车队车辆逐级查询 */
data class TeamsCars(
    val carList: List<CarInfo>,
    val teamList: List<TeamInfo>
)

/** 车辆信息 */
data class CarInfo(
    val carId: String = "",
    val carPlate: String = "",
    val carName: String = "",
    val stateCn: String = "",
    val iconLink: String = "",
    val state: String = "",
    val teamId: String = "",
    val teamName: String? = "",
    val acc: String = "",
    val videos: String?,
    val plateColorCode: String?,
    val plateColor: String?,
    val des: String?,
    val owner: String?,
    val ownerPhone: String?,
    val makerModel: String?, //  终端厂商
    val tmnKey: String?, // 13300000004
    val tmnNo: String?, // 13300000004
    val sim: String?,
    val simMeal: String?,
    val simType: String?,
    val videoType: String?,
    val driverName: String?, // 张国栋
    val driverPhone: String?,
    val serveSDate: String?,
    val serveEDate: String?,
    val driverInfo: List<Driver>?,
    val expirTime: String? = "", // 2023-01-21
    val tmnPicMap: Map<String, String>?,
    val carPicMap: Map<String, String>?,
    val adasTmn: BaseTmn?,
    val videoTmn: BaseTmn?,
    val mainTmn: BaseTmn?,
)

data class BaseTmn(
    val expirTime: String? = "",
    val keyType: String = "",
    val makerModel: String? = "",
    val sim: String? = "",
    val simMeal: String? = "",
    val simType: String? = "",
    val tmnId: String? = "",
    val tmnKey: String? = "",
    val tmnNo: String? = "",
    val type: String?,
    val adasTmnPicMap: Map<String, String>?,
    val tmnPicMap: Map<String, String>?,
    val videoTmnPicMap: Map<String, String>?
)

data class ComTmn(
    val type: Int,
    val picMap: MutableList<String>? = null,
    val keyValues: MutableList<KeyValue> = mutableListOf()
)

data class Driver(val driverName: String?, val driverPhone: String?)
data class DeleteJson(val car: MutableList<String>, val tmn: MutableList<String>)

/** 车辆列表 */
data class CarsInfo(val carList: MutableList<CarInfo>)

/** 模糊查询车辆 */
data class CarLick(
    val carId: String, // 105235
    val carName: String, // 演示04
    val carPlate: String, // 演示04
    val iconLink: String, // http://106.14.186.44:9999/gps-web/rs/img/map/car/default/10.png
    val videos: String?, // {"vs":"4::0:v,3::0:v,2::0:v,1::0:v"}
    val plateColor: String = "", // 黄色
    val plateColorCode: String = "", // 2
    val sim: String = "", // 15858288043
    val teamId: String = "", // 4771
    val teamName: String = "" // 一车队
)

/** 图例 */
data class Legend(
    val iconUrl: String = "",
    val stateIndex: String = "",
    val name: String = ""
)

/** 报警类型 */
data class AlarmType(
    val id: String = "",
    val name: String = "",
    var isAllChoose: Boolean = false,
    val children: MutableList<Children>
) {
    data class Children(
        val id: String = "",
        val name: String = "",
        var isChoose: Boolean = false
    )
}

data class AlarmSub(
    val id: String,
    val name: String,
    var isChoose: Boolean,
    val pid: String,
    val position: Int,
    override val itemType: Int,
) : MultiItemEntity

/** 里程查询-按日 */
@Parcelize
data class DayMile(
    val mile: String = "",
    val list: ArrayList<MileInfo>,
    val long: String = ""
) : Parcelable {
    @Parcelize
    data class MileInfo(
        val name: String = "",
        val mile: String = ""
    ) : Parcelable
}

/** 历史报警 */
@Parcelize
data class HistoryAlarm(
    val total: String = "",
    val list: MutableList<TotalAlarms> = arrayListOf(),
    val long: String = ""
) : Parcelable {
    @Parcelize
    data class TotalAlarms(
        val total: Int,
        val name: String = "",
        val list: ArrayList<InfoAlarms>
    ) : Parcelable {
        @Parcelize
        data class InfoAlarms(
            val addr: String = "",
            val alarmType: String = "",
            val blat: String = "",
            val blng: String = "",
            val etime: String = "",
            val fjNum: String = "",
            val glat: String = "",
            val glng: String = "",
            val lat: String = "",
            val lng: String = "",
            val long: String = "",
            val ruleName: String = "",
            val solveDes: String = "",
            val solveState: String = "",
            val solveTime: String = "",
            val solveUser: String = "",
            val speed: String = "",
            val stime: String = ""

        ) : Parcelable
    }
}

/** 报警统计 */
@Parcelize
data class AlarmCount(
    val iconLink: String = "",
    val alarmNum: Int = 0,
    val alarmName: String = "",
    val alarmType: String = ""
) : Comparable<AlarmCount>, Parcelable {
    override fun compareTo(other: AlarmCount): Int {
        return other.alarmNum - this.alarmNum
    }
}

/** 报警详情 */
data class AlarmDetail(
    val drvPhone1: String = "",
    val carId: String = "",
    val fjNum: String?,
    val speed: String = "",
    val alarmName: String = "",
    val addr: String = "",
    val lng: String = "",
    val carPlate: String = "",
    val blng: String = "",
    val glat: String = "",
    val drvName1: String = "",
    val blat: String = "",
    val time: String = "",
    val glng: String = "",
    val ruleName: String = "",
    val carName: String = "",
    val alarmType: String = "",
    val teamName: String? = "",
    val lat: String = "",
    val src: String? = "",
    var isChoose: Boolean = false
)

/**
 * 报警处理
 *
 * @property startTime
 * @property carId
 * @property typeId
 * @property src
 * @constructor Create empty Alarm handle
 */
data class AlarmHandle(
    val startTime: String,
    val carId: String,
    val typeId: String,
    val src: String?
)

/** 报警附件 */
@Parcelize
data class AlarmMedia(
    val mediaList: MutableList<MediaInfo>,
    val mediaNum: Int,
    val mediaType: String = ""
) : Parcelable {
    @Parcelize
    data class MediaInfo(
        val addr: String = "",
        val blat: String = "",
        val blng: String = "",
        val channel: String = "",
        val fullLink: String = "",
        val glat: String = "",
        val glng: String = "",
        val lat: String = "",
        val link: String = "",
        val lng: String = "",
        val reason: String = "",
        var teamName: String = "",
        val speed: String = "",
        val time: String = ""
    ) : Parcelable
}

/** 历史照片 */
data class PhotoInfo(
    val time: String = "",
    val reason: String = "",
    val speed: String = "",
    val link: String = "",
    val fullLink: String = "",
    val addr: String = ""
)

/** 费用分析 */
@Parcelize
data class Fees(
    val fees: ArrayList<FeeInfo>
) : Parcelable

/** 费用信息 */
@Parcelize
data class FeeInfo(
    val addOilCapacity: Double,
    val addOilFee: Double,
    val carId: String,
    val chargeFee: Double,
    val dateSplit: String,
    val insureFee: Double,
    val mile: Double,
    val mileOil: Double,
    val otherFee: Double,
    val repairFee: Double,
    val totalFee: Double,
    val trafficFee: Double,
    val yearAdtFee: Double
) : Parcelable

/** 整体数据 */
data class AllData(
    val alarmTrends: List<AlarmTrend>,
    val offlineMap: OfflineMap,
    val stateDetails: List<StateDetail>,
    val alarmGroups: AlarmGroups
) {
    data class AlarmTrend(
        val nums: Float,
        val day: String = ""
    ) : Comparable<AlarmTrend> {
        override fun compareTo(other: AlarmTrend): Int {
            return other.nums.toInt() - this.nums.toInt()
        }
    }

    data class OfflineMap(
        val offNum3: Int,
        val offNum2: Int,
        val offNum1: Int,
        val offNum3day: Int,
        val offNum7day: Int,
        val offNumLong: Int
    )

    data class StateDetail(
        val totalNum: String = "",
        val accOnNum: String? = "0",
        val accOffNum: String? = "0",
        val stopNum: String = "",
        val storageNum: String = "",
        val runNum: String = "",
        val alarmNum: String = "",
        val nogpsNum: String = "",
        val offNum: String = "",
        val onNum: String = "",
        val invalidNum: String = "",
        val noGpsNum: String? = "0",
        val expireNum: String? = "0"
    )

    data class AlarmGroups(
        val adass: MutableList<AlarmInfo>,
        val normals: MutableList<AlarmInfo>,
        val videos: MutableList<AlarmInfo>,
        val normal: Int,
        val adas: Int,
        val video: Int
    ) {

    }
}

data class AlarmInfo(
    val id: String = "",
    val iconLink: String = "",
    val name: String = "",
    val value: String = ""
)

/** 停车统计 */
@Parcelize
data class StopStats(
    val total: String = "",
    val list: MutableList<StopInfo>?,
    val long: String = ""
) : Parcelable {
    @Parcelize
    data class StopInfo(
        val total: Int,
        val name: String = "",
        val list: ArrayList<StopDetail>?
    ) : Parcelable {
        @Parcelize
        data class StopDetail(
            val stime: String = "",
            val etime: String = "",
            val addr: String = "",
            val long: String = ""
        ) : Parcelable
    }
}

/** 模拟量设置 */
data class SensorCfg(
    val unit: String = "",
    val analogCode: String = "",
    val mnIndex: String = "",
    val name: String = ""
)

/** 模拟量统计 */
data class SensorInfo(
    val unit: String = "",
    val time: String = "",
    val moniValue: String = "",
    val realValue: String?
)

/** 提醒查询 */
data class RemindInfo(
    val carId: String = "",
    val now: String = "",
    val `set`: String = "",
    val name: String = "",
    val next: String = "",
    val plate: String = "",
    val type: String = ""
)

/** 整点状况 */
data class HourPoint(
    var time: String = "",
    val detail: PointInfo
) : Comparable<HourPoint> {
    data class PointInfo(
        val carId: String = "",
        val drct: Int,
        val exts: String = "",
        val lat: Double,
        val lng: Double,
        val mile: Int,
        val satl: Int,
        val sgn: Int,
        val sgnStts: String = "",
        val speed: Int,
        val state: Int,
        var time: String = "",
        val tmnMile: Int
    )

    override fun compareTo(other: HourPoint): Int {
        return time.replace("h", "").toInt() - other.time.replace("h", "").toInt()
    }
}

/** Acc统计 */
@Parcelize
data class AccStats(
    val offtime: Int,
    val time: String = "",
    val carId: String = "",
    val ontime: Int,
    val details: MutableList<AccInfo>?,
    val onratio: String = ""
) : Parcelable {
    @Parcelize
    data class AccInfo(
        val saddr: String? = "",
        val duration: Int,
        val time: String = "",
        val carId: String = "",
        val ison: Boolean,
        val eaddr: String? = "",
        val stime: String = "",
        val etime: String = ""
    ) : Parcelable
}

/** 车辆登退签 */
@Parcelize
data class CarSign(
    val duration: Long,
    val carId: String = "",
    val details: MutableList<SignDetail>,
    val mile: Int = 0,
    val repair: Boolean = false
) : Parcelable

/** 驾驶员登退签 */
@Parcelize
data class DriverSign(
    val idNo: String = "",
    val duration: Int,
    val carPlates: String = "",
    val details: MutableList<SignDetail>,
    val name: String = "",
    val mile: Int,
    val repair: Boolean
) : Parcelable

/** 登退签详情 */
@Parcelize
data class SignDetail(
    val onTime: String? = "",
    val idNo: String = "",
    val duration: Int = 0,
    val carId: String = "",
    val offTime: String?,
    val name: String = "",
    val mile: Int,
    val offAddr: String?,
    val repair: Boolean = false,
    val onAddr: String? = ""
) : Parcelable

/** 驾驶员信息 */
data class DriverInfo(
    val atime: String = "",
    val auser: String = "",
    val cmpId: String = "",
    val icCard: String = "",
    val id: String = "",
    val license: String = "",
    val name: String = "",
    val phone: String = "",
    val sex: String = "",
    val teamId: String = "",
    val exts: String = "",
    val picProtocol: String = "",
    val picSrc: String = ""
)

/** 流量统计 */
@Parcelize
data class FlowStats(
    val flows: MutableList<FlowInfo>,
    var total: Long,
    var long: Long
) : Parcelable

/** 流量信息 */
@Parcelize
data class FlowInfo(
    val day: String = "",
    val longs: Long,
    val total: Long,
    val gps: Long,
    val pic: Long,
    val video: Long,
    val adas: Long,
    val other: Long
) : Parcelable

/** 查岗历史 */
@Parcelize
data class CheckInfo(
    val checkId: String = "",
    val checkType: String = "",
    val cnt: String = "",
    val id: String = "",
    val joinCode: String = "",
    val joinId: String = "",
    val objId: String = "",
    val objName: String = "",
    val objType: String = "",
    val reply: String = "",
    val replyMan: String = "",
    val replyPhone: String = "",
    val replyTime: String = "",
    val seqNo: String = "",
    val serverTime: String = ""
) : Parcelable

/** 保险信息 */
@Parcelize
data class InsureInfo(
    val advanceRemindDays: Int,
    val agent: String = "",
    val atime: String = "",
    val auser: String = "",
    val carId: String = "",
    val claims: String?,
    val cmpId: String?,
    val discount: Int,
    val effectiveTime: String = "",
    val failureTime: String = "",
    val id: String = "",
    val insuranceCmp: String = "",
    val insuranceCode: String = "",
    val insuranceType: String = "",
    val phone: String = "",
    val price: Double,
    val realPrice: Double,
    val remark: String?
) : Parcelable

/** 证件信息 */
@Parcelize
data class CardInfo(
    val advanceRemindDays: Int,
    val atime: String = "",
    val auser: String = "",
    val brandModel: String?,
    val carId: String = "",
    val cmpId: String = "",
    val drivingCode: String?,
    val effectiveTime: String? = "",
    val engineNumber: String?,
    val failureTime: String? = "",
    val businessScope: String?,
    val transportCode: String?,
    val id: String = "",
    val remark: String?,
    val useNature: String?
) : Parcelable

/** 指令日志 */
data class CmdLog(
    val content: String?,
    val oper: String?,
    val time: String?,
    val typeId: String?,
    val carId: String?,
    val cmd: String?,
    val cmdId: String?,
    val `data`: String?,
    val ip: String?,
    val seqId: String?,
    val times: String?,
    val tmnKey: String?,
    val userId: String?,
    val utime: String?
)

/** 指令详情 */
data class CmdInfo(
    val id: String = "",
    val name: String = "",
    val cmd: String?
)

/** 指令类型 */
data class LogTypeInfo(
    val action: String = "",
    val id: String = "",
    val res: String = "",
    val seq: Int
)

/** 区域统计 */
data class RegionStats(
    val regionName: String = "",
    val carList: List<String>,
    val regionShape: String = "",
    val regionId: String = ""
)

/**
 * 标注信息
 */
data class PoiStati(
    val addr: String,
    val blat: Double,
    val blng: Double,
    val carIds: List<String>,
    val glat: Double,
    val glng: Double,
    val icon: String,
    val lat: Double,
    val lng: Double,
    val poiId: String,
    val poiName: String,
    val radius: Int
)

/** 区域信息 */
@Parcelize
data class RegionInfo(
    val id: String = "",
    val name: String = "",
    val pid: String = "",
    val shape: String? = "",
    val type: String = "",
    val radius: Int?,
    var isChecked: Boolean = false,
    var children: MutableList<RegionInfo>? = null,
) : Parcelable

/**
 * 标注信息
 */
data class PoiInfo(
    val id: String = "",
    val name: String = "",
    val pid: String = "",
    val type: String = "",
    val radius: Int?,
    var isChecked: Boolean = false,
)

/** 区域查车 */
@Parcelize
data class RegionCar(
    val duration: Int,
    val time: String = "",
    val carId: String = "",
    val stopSeconds: Long?,
    val moveSeconds: Long?,
    val details: MutableList<Detail>,
    val mile: Int
) : Parcelable {
    @Parcelize
    data class Detail(
        val saddr: String = "",
        val duration: Long,
        val moveSeconds: Long?,
        val stopSeconds: Long?,
        val time: String = "",
        val carId: String = "",
        val eaddr: String = "",
        val stime: String = "",
        val etime: String = "",
        val mile: Int,
        val areas: String = ""
    ) : Parcelable
}

/** 离线统计信息 */
@Parcelize
data class OfflineInfo(
    val carName: String = "",
    val carPlate: String = "",
    val lineTime: String = "",
    val nowTime: String = "",
    val offlineTime: String = "",
    val simCode: String? = "",
    val teamName: String = "",
    val addr: String?,
    val time: String?,
    val tmnCode: String? = ""
) : Parcelable

/** 欠费统计信息 （运营状况） */
@Parcelize
data class ArrearsInfo(
    val teamName: String = "",
    val expTime: String = "",
    val atime: String = "",
    val appear: String = "",
    val carName: String = "",
    val expModel: String = "",
    val auser: String = "",
    val carPlate: String = ""
) : Parcelable

/** 短信指令 */
data class SmsCmdInfo(
    val children: MutableList<Children>,
    val name: String = "",
    var isChoose: Boolean = false,
    var index: Int = 0,
    var id: String = ""
) {
    data class Children(
        val children: MutableList<Children>,
        val name: String = ""
    ) {
        data class Children(
            val cmd: String = "",
            val desc: String = ""
        )
    }
}


/** 维修列表 */
@Parcelize
data class RepairInfo(
    val id: String = "",
    val carId: String = "",
    val tickTime: String? = "",
    val plate: String? = "",
    val tickPhone: String? = "",
    val tmnKey: String? = "",
    val tmnNo: String? = "",
    val tickName: String? = "",
    val auser: String = "",
    val simCard: String? = "",
    val tickDesc: String? = "",
    var range: Float? = 0f,
    val addr: String? = "",
    var lat: String? = "", // 32.89647204943718
    var lng: String? = "", // 115.81851493347635
    var glat: String? = "", // 32.89647204943718
    var glng: String? = "", // 115.81851493347635
    var blat: String? = "", // 32.89647204943718
    var blng: String? = "", // 115.81851493347635
    val imgs: ArrayList<String>
) : Parcelable

/** 登录历史 */
data class HistoryLogin(
    val time: String = "",
    val addr: String = "",
    val ip: String = ""
)

/** 关于我们 */
data class AboutUs(
    val platformUrl: String = "",
    val cmpUrl: String = "",
    val phone: String = "",
    val email: String = "",
    val cnName: String = "",
    val list: MutableList<AboutInfo>,
    val addr: String = "",
    val linkman: String = "",
    val date: String?,
    val version: String = ""
) {
    data class AboutInfo(
        val id: String = "",
        val name: String = "",
        val seq: String = "",
        val qr: String = "",
        val version: String = ""
    )
}

/** 更新 */
data class UpdateEntity(
    val status: Int,
    val time: Long,
    val result: Result
) {
    data class Result(
        val links: List<Link>,
        val version: Int,
        val versionDate: String = "",
        val versionName: String? = "",
        val userId: String = "",
        val updateDesc: String = ""
    ) {
        data class Link(
            val name: String = "",
            val seq: Int,
            val des: String = "",
            val typeId: String = "",
            val id: String = "",
            val cfg: String = "",
            val pack: String = "",
            val brand: String = ""
        )
    }
}

/** 欠费通知 */
@Parcelize
data class ArrearsNotice(
    val expire: MutableList<Expire> = arrayListOf(),
    val willExpire: MutableList<Expire> = arrayListOf()
) : Parcelable

/**
 * Expire  欠费
 *
 * @property atime
 * @property auser
 * @property carId
 * @property des
 * @property endDay
 * @property id
 * @property money
 * @property name
 * @property plate
 * @property result
 * @property startDay
 * @constructor Create empty Expire
 */
@Parcelize
data class Expire(
    val atime: String = "",
    val auser: String = "",
    val carId: String = "",
    val des: String = "",
    val endDay: String = "",
    val id: String = "",
    val money: String = "",
    var name: String = "",
    var plate: String = "",
    val result: String = "",
    val startDay: String = ""
) : Parcelable


data class Charge(
    val atime: String = "",
    val auser: String = "",
    val carId: String = "",
    val sdate: String = "",
    val edate: String = "",
    val money: String? = "",
    val mode: String = "",
    val phone: String? = "",
    val day: String? = "",
    val intvl: String? = "",
    val des: String = ""
) {
    override fun toString(): String {
        return "Charge(atime='$atime', auser='$auser', carId='$carId', sdate='$sdate', edate='$edate', money=$money, mode='$mode', phone=$phone, day=$day, intvl=$intvl, des='$des')"
    }
}

/** 常用文本信息 */
data class CmdNote(
    val sysList: List<String> = mutableListOf(),
    val userList: List<String>? = mutableListOf()
)

/** 报警处理常用文本信息 */
data class AlarmNote(
    val sysNote: List<String> = mutableListOf(),
    val userNote: List<String>? = mutableListOf()
)

/** 设备异常信息 */
data class DeviceExc(
    val count: Int = 0,
    val name: String = "",
    val real_name: String = ""
)

/** 设备异常详情 */
data class DeviceInfo(
    val addr: String = "",
    val alarm: List<String> = listOf(),
    val carId: String = "",
    val name: String = "",
    val plate: String = "",
    val owner: String? = "",
    val ownerPhone: String? = "",
    val satl: Int = 0,
    val sgn: Int = 0,
    val state: Int = 0,
    val time: String = ""
)

/** 联系我们 */
data class ContactUs(
    val addr: String = "",
    val name: String = "",
    val phone: String = "",
    val pic: String = "",
    val picUrl: String = "",
    val type: String = "",
    val qq: String = "",
    val wechat: String = ""
)

/** 周边车辆 */
data class CarAround(
    val accTime: String, // 当前[开] 今日开:13时23分33秒
    val addr: String, // 海南省海口市秀英区长流镇;长安路;阳光西海岸-一期,阳光西海岸,天佑大酒店
    val blat: String, // 20.045642981580112
    val blng: String, // 110.23276923608195
    val carId: String, // 108321
    val carName: String, // 演示车11
    val carPlate: String, // 演示车11
    val distance: String, // 0.00
    val drct: String, // 268
    val drctCn: String, // 偏西
    val glat: String, // 20.039956328536437
    val glng: String, // 110.22621231418552
    val iconLink: String, // http://106.14.186.44:9999/gps-web/rs/img/map/car/car_police/10.png
    val lat: String, // 20.042098
    val lng: String, // 110.221949
    val runStopTime: String, // 停-35分2秒
    val speed: String, // 0
    val state: String, // 10
    val stateCn: String, // 在线-停车-ACC开
    val time: String // 2022-03-11 15:40:07
)

/** 字典 */
data class Dictionary(
    val CAR_TYPE: MutableList<CarType>,
    val rspCode: String = "",
    val PLATE_COLOR: MutableList<PlateColor>,
    val USER_EXT: MutableList<PlateColor>,
) {
    data class CarType(
        val id: String = "",
        val name: String = "",
        val pid: String = ""
    )

    data class PlateColor(
        val id: String = "",
        val name: String = ""
    )
}

/**
 */
@Parcelize
data class QrCode(
    val teamName: String = "",
    val carType: String = "",
    val drvName: String = "",
    val carName: String = "",
    val plate: String = "",
    val addr: String = "",
    val tmnNo: String = "",
    val drvPhone: String = "",
    val simCard: String = "",
    val instTime: String? = null,
    val atime: String? = null,
) : Parcelable, CmdReply()

/** 发送指令回复 */
open class CmdReply(var rspCode: String = "", var rspDesc: String? = "失败原因未返回")

/**
 * ********************************* 自定义
 * ************************************************
 */

/** 历史视频 */
data class HistoryVideo(
    val state: String,
    val result: MutableList<Result>
) {
    data class Result(
        val storeType: Int,
        val avType: Int,
        val streamType: Int,
        val fileSize: Long,
        val channel: Int,
        var channelName: String?,
        val startTime: String = "",
        val endTime: String = "",
        val alarmFlag: String = "",
        val fileName: String = "",
        val fileId: String = "",
        var duration: Long = 0
    ) : Serializable
}

/** 用户列表 */
@Parcelize
data class UserList(
    var list: MutableList<UserInfo> = arrayListOf()
) : Parcelable

@Parcelize
data class UserInfo(
    var ip: String = UserConstant.current_ip,
    var port: String = UserConstant.current_port,
    var platform: String = "",
    var userName: String = "",
    var userPwd: String = "",
    var carName: String = "",
    var carPwd: String = "",
    var isRemember: Boolean = true,
    var isAuto: Boolean = false,
    var isCarRemember: Boolean = true,
    var isCarAuto: Boolean = false,
    var homeShow: String = "home",
    var plateColor: String = "",
    var colorId: String = "",
    var loginType: String = Keys.LOGIN_TYPE_USER,
    var videos: String? = "",
    var isHttps: Boolean = false
) : Parcelable

/** 用户列表 */
@Parcelize
data class UserList1(
    var list: MutableList<UserInfo1> = arrayListOf()
) : Parcelable

@Parcelize
data class UserInfo1(
    var ip: String = UserConstant.current_ip,
    var port: String = UserConstant.current_port,
    var platform: String = "",
    var userName: String = "",
    var userPwd: String = "",
    var carName: String = "",
    var carPwd: String = "",
    var isRemember: Boolean = true,
    var isAuto: Boolean = false,
    var isCarRemember: Boolean = true,
    var isCarAuto: Boolean = false,
    var homeShow: String = "home",
    var plateColor: String = "",
    var colorId: String = "",
    var loginType: String = Keys.LOGIN_TYPE_USER,
    var videos: String? = ""
) : Parcelable


/** 视频报警 */
data class VideoAlarm(
    val alarmImgId: Int,
    val alarmTitleId: Int,
    var isNormal: Boolean = false
)

/** 车队车辆选择类 */

data class ChooseTeamCar(
    val pid: String = "",
    val carId: String = "",
    val carNum: Int = 0,
    val teamId: String = "",
    val carName: String = "",
    val carPlate: String = "",
    val teamName: String = "",
    val iconLink: String = "",
    val accState: String = "",
    val state: String = "",
    val videos: String? = "",
    val isVideo: Boolean = false
)

/** 选择的时间 */
data class ChooseTime(
    val timeNameId: Int,
    val timeType: Int = 4,
    val timeNum: Int
)

/** @Author Jasper @Time 2020/7/24 @Desc 历史车辆数据 */
@Parcelize
data class HistoryCars(
    val list: MutableList<ListBean> = ArrayList()
) : Parcelable {
    @Parcelize
    data class ListBean(
        val carId: String = "",
        val carName: String = "",
        val carPlate: String = "",
        var iconLink: String = "",
        var videos: String? = "",
        var isVideo: Boolean = false
    ) : Parcelable
}

data class HistoryCar(
    val carId: String = "",
    val carName: String = "",
    val carPlate: String = "",
    val iconLink: String = "",
    val videos: String? = "",
    val isVideo: Boolean = false,
    val teamId: String? = "",
    val teamName: String? = "",
    val noAuth: String = ""
)

data class KeyValue(val key: String, var value: String)


/** 搜索历史 */
@Parcelize
data class KeyWords(
    val words: MutableList<String> = mutableListOf()
) : Parcelable

/** 推送消息 */
data class PushMsg(
    val type: String,
    val content: MsgInfo
) {
    data class MsgInfo(
        val carName: String = "",
        val alarmName: String = "",
        val addr: String = "",
        var teamName: String? = "",
        val carPlate: String = ""
    )
}

/** CarTab */
data class CarTab(val tabTitleId: Int, val tabImgId: Int)
data class WholeTab(val title: String, val imgId: Int)

/** 通知消息文件 */
data class NoticeFiles(
    val id: String = "",
    val name: String = "",
    val suffix: String = ""
)

/** 实时视频实体类 */

data class RealVideoInfo(
    var uuid: String = "",
    var videoStream: String = AppConfigs.streamType,
    var videoPass: String = "",
    var videoName: String = "",
    val toast: String = "",
    var isChecked: Boolean = true
)


/** 视频通道 */
data class VideosPass(
    val vs: String? = "",
    val tc: String?,
    val t: String?
)

/** 视频通道 */
data class Videos(
    val vs: String = "",
)

/** 车辆基础性息 */
data class CarBaseInfo(
    val plate: String,
    val carName: String,
    val color: String,
    val teamName: String,
    val videoPass: String,
    val ownerName: String?,
    val ownerPhone: String?,
    val desc: String?,
)

/** 临时跟踪 */
data class GpsTrack(val interval: String, val duration: String)

/** 文本信息 */
data class SendText(val signBit: String, val textMsg: String, val textType: String = "1")

/** 油电控制 */
data class OilElectric(val command: String)

/** data class OilElectric(val command: String) */
data class ElectricDefine(val flag: String, val authCode: String = "1010101")

/** name 标题 isSwitching 是否开启 num 排序 */
data class LocationStatus(
    val key: String,
    var switch: Int,
    var value: String = "",
    var name: String = ""
)

/** 标注 */
data class LocationPoi(
    val addr: String?, // 浙江省台州市椒江区赤山路
    val atime: String, // 2021-01-30 17:38:29
    val auser: String, // admin
    val blat: Double?, // 28.66443569942224
    val blng: Double?, // 121.43862729508616
    val cmpId: String, // 1
    val exts: String?, // {"bzfx":"1212"}
    val format: String?, // jspx
    val glat: Double?, // 28.65810536951957
    val glng: Double?, // 121.43222398013118
    val icon: String?, // 公共设施/生活服务.png
    val id: String, // 471
    val lat: Double?, // 28.6610599361975
    val lng: Double?, // 121.42780347176063
    val name: String, // 演示专用
    val pid: String, // 0
    val radius: Int?, // 500
    val type: String, // 0
    val updateTime: String, // 2021-01-30 17:38:29
    val zcode: String? // 331002_中国 浙江省 台州市 椒江区
)

/** 登录前设置 */
data class LoginPre(
    val loginSms: Boolean,
    val plateColorVfy: Boolean,
    val mode: String = "false",
    val plateColor: String? = null
)

/**
 * **********************************************************************************
 */
data class AllMenuCfg(val titleId: Int, val keys: ArrayList<MenuNo>)
data class MenuNo(val key: String, val no: Int, var isChoose: Boolean = false)
data class MenuCfg(
    val key: String,
    val titleId: Int = 0,
    val icon: Int = 0,
    val title: String = "",
    val iconLink: String = "",
    val webUrl: String = ""
)

/** arrears：欠费通知开关 alarms：报警通知开关 alarmFilter：过滤无报警类型开关  mapRefreshTime:刷新时间 */
data class InfoSwitch(
    val arrears: Boolean = true,
    val alarms: Boolean = false,
    val alarmFilter: Boolean = false,
    val mapRefreshTime: String = "5",
    val fixCenter: Boolean = false,
    val onlineNotice: Boolean? = false
)

/**
 * Video state 视频状态
 *
 * @property state
 * @constructor Create empty Video state
 */
data class VideoState(val state: String?, val jd: String?, val size: Long?, val url: String?)

/**
 * Check login
 *
 * @property result
 * @property status
 * @property time
 * @constructor Create empty Check login
 */
data class CheckLogin(
    val result: String,
    val status: Int,
    val time: Long
)

/**
 * 行车统计
 *
 * @property carId
 * @property details
 * @property duration
 * @property eaddr
 * @property maxSpeed
 * @property mile
 * @property moveSeconds
 * @property overSpeedCount
 * @property saddr
 * @property stopSeconds
 * @property time
 * @constructor Create empty Run car
 */
data class RunCar(
    val carId: String,
    val teamName: String,
    val details: MutableList<RunDetail>,
    val duration: Int,
    val eaddr: String,
    val maxSpeed: Int,
    val mile: Int,
    val moveSeconds: Int,
    val overSpeedCount: Int,
    val saddr: String,
    val stopSeconds: Int,
    val time: String
)

/**
 * 行驶状态分析
 *
 * @property duration
 * @property eaddr
 * @property etime
 * @property lat
 * @property lng
 * @property mile
 * @property saddr
 * @property stime
 * @property type
 * @constructor Create empty Run car state
 */
data class RunCarState(
    val duration: Int,
    val eaddr: String,
    val etime: String,
    val lat: Double,
    val lng: Double,
    val mile: Int,
    val saddr: String,
    val stime: String,
    val alarmName: String?,
    val region: String?,
    val type: String
)

/**
 * 行车统计分析详情
 *
 * @property areaNames
 * @property areas
 * @property carId
 * @property duration
 * @property eaddr
 * @property elat
 * @property elng
 * @property emile
 * @property etime
 * @property lat
 * @property lng
 * @property maxSpeed
 * @property mile
 * @property moveSeconds
 * @property saddr
 * @property smile
 * @property stime
 * @property stopSeconds
 * @property time
 * @constructor Create empty Run detail
 */
data class RunDetail(
    val areaNames: String,
    val areas: String,
    val carId: String,
    val duration: Int,
    val eaddr: String,
    val elat: Double,
    val elng: Double,
    val emile: Int,
    val etime: String,
    val lat: Double,
    val lng: Double,
    val maxSpeed: Int,
    val mile: Int,
    val moveSeconds: Int,
    val saddr: String,
    val smile: Int,
    val stime: String,
    val stopSeconds: Int,
    val time: String
)

/**
 *  获取账号信息
 *
 * @property addr
 * @property dueDate
 * @property email
 * @property ipLimit
 * @property limitType
 * @property name
 * @property phone
 * @property sex
 * @property userId
 * @constructor Create empty Self info
 */
data class SelfInfo(
    val addr: String?,
    val dueDate: String?,
    val email: String?,
    val ipLimit: String?,
    val limitType: String?,
    val name: String?,
    val phone: String?,
    val sex: String?,
    val userId: String
)

/**
 * 权限下的油卡
 *
 * @property atime
 * @property auser
 * @property cmpId
 * @property oilCardNo
 * @property oilType
 * @property price
 * @property remark
 * @property teamCode
 * @constructor Create empty Oil card item
 */
data class OilCard(
    val atime: String,
    val auser: String,
    val cmpId: String,
    val oilCardNo: String,
    val oilType: String,
    val price: String,
    val remark: String,
    val teamCode: String
)

/**
 * 胎压详情
 *
 * @property array
 * @property plate
 * @property time
 * @constructor Create empty Psi rpt item
 */
data class PsiRpt(
    val array: List<List<String>>,
    var state: Int,
    var point: String,
    var pressure: String,
    var temp: String,
    var elect: String,
    var plate: String,
    var time: String
)

/**
 * 行政区域
 *
 * @property code
 * @property name
 * @property isChoose
 * @property provinceChildren
 * @constructor Create empty Admin region
 */
data class AdminRegion(
    val code: String,
    val name: String,
    var pid: String,
    var isChoose: Boolean,
    val provinceChildren: MutableList<ProvinceChildren>?
)

data class ProvinceChildren(
    val code: String,
    val name: String,
    var pid: String,
    var isChoose: Boolean,
    val cityChildren: MutableList<CityChildren>?
)

data class CityChildren(
    val code: String,
    val name: String,
    var pid: String,
    var isChoose: Boolean
)


data class ChooseRegion(val id: String, val isAdmin: Boolean, val name: String)

data class Region(
    var isAdmin: Boolean,
    var isChoose: Boolean,
    var id: String,
    var pid: String,
    var name: String,
    var type: String,
    var child: MutableList<Region>?,
    var level: Int = 0
)

data class Admin(
    var isChoose: Boolean,
    var id: String,
    var pid: String,
    var name: String,
    var isProvince: Boolean,
    var child: MutableList<Admin>?
)

data class OnlyCarInfo(val index: Int, val type: String, var value: String = "")


data class FwdRev(
    val teamName: String,
    val owner: String,
    val carPlate: String,
    val posiTime: Int?,
    val negaTime: Int?,
    val stopTime: Int?,
    val count: String,
    val detail: MutableList<FwdRevInfo>
)

class FwdRevInfo(
    val stime: String,
    val etime: String,
    val state: String,
    val duration: Int?,
    val saddr: String?,
    val eaddr: String?
)

///////车管家定制///////
data class IntentParam(
    val model: String?,
    val iscUuid: String?
)


data class UserJson(
    val iscUuid: String?,
    val userId: String?,
    val password: String?
)
///////车管家定制///////

/**
 * 车辆状态
 *
 * @property carName
 * @property carPlate
 * @property simCard
 * @property teamName
 * @property tmnKey
 * @property tmnNo
 * @constructor Create empty Car state
 */
data class CarState(
    val carName: String,
    val carPlate: String,
    val simCard: String,
    val teamName: String,
    val tmnKey: String,
    val tmnNo: String
)

/**
 * 离线状态详情
 *
 * @property addr
 * @property carName
 * @property carPlate
 * @property gpsTime
 * @property offlineDuration
 * @property offlineTime
 * @property teamName
 * @constructor Create empty Offline state item
 */
data class OfflineState(
    val addr: String,
    val carName: String,
    val carPlate: String,
    val gpsTime: String,
    val offlineDuration: String,
    val offlineTime: String,
    val teamName: String
)


data class AlarmCar(
    val carPlate: String = "",
    val carName: String = "",
    val num: Int,
    val carId: String = ""
) : Comparable<AlarmCar> {
    override fun compareTo(other: AlarmCar): Int {
        return other.num - this.num
    }
}

data class RegionState(
    val id: String,
    val name: String,
    val pid: String,
    val points: List<Point>,
    val shape: String,
    val radius: Int,
    val type: String
)

data class Point(
    val lat: Double,
    val lng: Double,
    val glat: Double,
    val glng: Double,
    val blat: Double,
    val blng: Double
)

data class FunInfo(
    val key: String, var isChoose: Boolean, var isCheckable: Boolean = true
)

data class Menu(
    val a: String, var c: Boolean, var d: Boolean = true
)

data class TmnManager(
    var carId: String?,
    var teamId: String,
    var teamName: String,
    val carPlate: String?,
    val keyType: String,
    val pics: Map<String, String>? = null,
    val simCard: String,
    val tmnId: String,
    val tmnKey: String,
    val tmnNo: String,
    var isChoose: Boolean = false
)

data class TmnInfo(
    var teamId: String,
    var teamName: String,
    val keyType: String,
    val simCard: String,
    val tmnKey: String,
    val tmnNo: String,
    val tmnSign: String,
)

//车辆信息
data class CarMsg(
    val plate: String,
    val carName: String,
    val colorId: String,
    val color: String,
    val teamName: String,
    val teamId: String,
    var tmnKey: String,
    val videoSize: String,
    val owner: String,
    val ownerPhone: String,
    val videoChannel: String?,
    val desc: String
)

data class CarTmn(
    val carId: String,
    val carPlate: String,
    val carName: String,
    val isChoose: Boolean
)

data class LocationInfo(
    val dataType: String?,
    var factor: Double?,
    val id: String,
    val length: String?,
    val name: String,
    var offset: Int?,
    val seq: Int?,
    val sgnType: String,
    val signType: Int?,
    val start: Int?,
    val type: String,
    val alarm: String?,
    var kvs: String?,
    var unit: String?,
    val pid: String?,
    val premise: String?,
    val gcount: String?,
    val exp: String?,
    var maximum: Int?,
    var minimum: Int?,
    var switch: Int,
    var verror: Double?,
    var vinvalid: Double?
)

data class CarDetail(
    val cmpId: String,
    val id: String,
    val name: String,
    val plate: String,
    val plateColor: String,
    val state: Int,
    val teamId: String,
    val tmnId: String?,
    val tmnKey: String?,
    val iconLink: String,
    val ownerPhone: String?,
    val driverId: String?,
    val owner: String?,
    val videos: String?,
    val acc: String?
)

data class TeamDetail(
    val banNum: Int,
    val carNum: Int,
    val cmpId: String,
    val delNum: Int,
    val id: String,
    val name: String,
    val acc: String,
    val pid: String,
    val noAuth: Boolean,
    val videoNum: Int,
    val offCount: Int? = null,
    val onCount: Int? = null
)

data class TeamCars(
    val teamList: List<TeamDetail>,
    val carList: List<CarDetail>
)

//车队车辆信息
data class TeamsAndCars(
    val carId: String? = null,
    val plate: String? = null,
    val carName: String? = null,
    val videos: String? = null,
    val iconLink: String? = null,
    val acc: String? = null,

    val teamId: String? = null,
    val teamName: String? = null,
    val carNum: Int = 0,
    val videoNum: Int = 0,
    val noAuth: Boolean = false,
    val isTeam: Boolean = false,

    var isChoose: Boolean = false,
    val offCount: Int? = null,
    val onCount: Int? = null

)

//视频通道设置
data class VideoPass(var pass: Int, var passName: String? = "", var cloud: String? = "0")

//首页数据
data class HomeData(
    val alarmCount: String,
    val alarmList: List<Alarm>,
    val arrearsNums: String,
    val carNums: String,
    val mileCount: Int,
    val mileList: List<Mile>,
    val offlineNums: String,
    val onlineNums: String,
    val safetyList: List<Safety>,
    val teamId: String,
    val teamName: String
)

data class Mile(
    val carId: String,
    val mile: Int,
    val plate: String
)

data class Safety(
    val alarmNums: String,
    val carId: String,
    val plate: String?
)

data class Alarm(
    val alarmNums: String,
    val carId: String,
    val plate: String
)

//模拟量数据
data class TypeInfo(val typeId: String, val typeName: String, var isChecked: Boolean = false)

//模拟量列表数据
data class ListItem(
    val time: String,
    val mile: Float,
    val speed: Float,
    val list: MutableList<KeyValue>
)

//实时视频设备操作
data class ActionData(var light: Int = 0, var wiper: Int = 0)

data class StaticData(val key: String, val title: String, val value: String)

data class VersionInfo(
    val result: Result,
    val status: Int,
    val time: Long
) {
    data class Result(
        val atime: String,
        val des: String,
        val id: String,
        val publishStatus: String,
        val type: Int,
        val userId: String,
        val version: String,
        val versionDate: String,
        val versionName: String,
        val webVersion: String
    )
}

data class ChangeCarTeam(val moditeam: Boolean)

data class GuideBanner(val textId: Int, val phoneId: Int)

data class IdentityInfo(
    val carId: String,
    val driverId: String,
    val driverName: String,
    val exts: String,
    val format: String,
    val gpsTime: String,
    val mat: String,
    val result: String,
    val type: String,
    val vlv: String
)

data class IdentityImg(val picUrl: String?, val preDrvPicUrl: String?)


data class TextCar(
    val carId: String,
    val plate: String,
    val name: String,
    val online: Boolean,
    val tmnKey: String?,
    var state: Status = Status.WAITING
)



